API Documentation
Public Member Functions | List of all members
nkTasks::LambdaTask Class Reference

Utility task using lambda functions to submit work. More...

Inheritance diagram for nkTasks::LambdaTask:
nkTasks::Task

Public Member Functions

 LambdaTask ()
 
 ~LambdaTask ()
 
virtual TASK_RESULT onWork () override
 
virtual void onWorkDone () override
 
virtual void onSuccess () override
 
virtual void onFail () override
 
virtual void onAbort () override
 
void setWorkFunc (std::function< TASK_RESULT()> func)
 
void setWorkDoneFunc (std::function< void()> func)
 
void setSuccessFunc (std::function< void()> func)
 
void setFailFunc (std::function< void()> func)
 
void setAbortFunc (std::function< void()> func)
 
- Public Member Functions inherited from nkTasks::Task
 Task ()
 
virtual ~Task ()
 
ThreadgetParentThread () const
 
TASK_RESULT getWorkResult () const
 
void setParentThread (Thread *thread)
 
void setWorkResult (TASK_RESULT result)
 

Detailed Description

Utility task using lambda functions to submit work.

Constructor & Destructor Documentation

◆ LambdaTask()

nkTasks::LambdaTask::LambdaTask ( )

Constructor.

◆ ~LambdaTask()

nkTasks::LambdaTask::~LambdaTask ( )

Destructor.

Member Function Documentation

◆ onWork()

virtual TASK_RESULT nkTasks::LambdaTask::onWork ( )
overridevirtual

See nkTasks::Task::onWork(). Reimplemented for this class to work.

Returns
See nkTasks::Task::onWork().

Implements nkTasks::Task.

◆ onWorkDone()

virtual void nkTasks::LambdaTask::onWorkDone ( )
overridevirtual

See nkTasks::Task::onWorkDone(). Reimplemented for this class to work.

Implements nkTasks::Task.

◆ onSuccess()

virtual void nkTasks::LambdaTask::onSuccess ( )
overridevirtual

See nkTasks::Task::onSuccess(). Reimplemented for this class to work.

Implements nkTasks::Task.

◆ onFail()

virtual void nkTasks::LambdaTask::onFail ( )
overridevirtual

See nkTasks::Task::onFail(). Reimplemented for this class to work.

Implements nkTasks::Task.

◆ onAbort()

virtual void nkTasks::LambdaTask::onAbort ( )
overridevirtual

See nkTasks::Task::onAbort(). Reimplemented for this class to work.

Implements nkTasks::Task.

◆ setWorkFunc()

void nkTasks::LambdaTask::setWorkFunc ( std::function< TASK_RESULT()>  func)

Allows to set the function executed by onWork().

◆ setWorkDoneFunc()

void nkTasks::LambdaTask::setWorkDoneFunc ( std::function< void()>  func)

Allows to set the function executed by onWorkDone().

◆ setSuccessFunc()

void nkTasks::LambdaTask::setSuccessFunc ( std::function< void()>  func)

Allows to set the function executed by onSuccess().

◆ setFailFunc()

void nkTasks::LambdaTask::setFailFunc ( std::function< void()>  func)

Allows to set the function executed by onFail().

◆ setAbortFunc()

void nkTasks::LambdaTask::setAbortFunc ( std::function< void()>  func)

Allows to set the function executed by onAbort().


The documentation for this class was generated from the following file: